diff options
| author | joost <joost@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2010-04-22 08:54:00 +0000 |
|---|---|---|
| committer | joost <joost@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2010-04-22 08:54:00 +0000 |
| commit | b87eb9a8bbb091e570a8a9dfd781efbbae6ebbc2 (patch) | |
| tree | 499bb2c1829cf6088b7cbcbefd51e43a761e6b3c /packages/fcl-base | |
| parent | 2cddaa63066d1bd9c7c9012f3acbb4afb91fdbcd (diff) | |
| download | fpc-b87eb9a8bbb091e570a8a9dfd781efbbae6ebbc2.tar.gz | |
* Moved fptemplate from fcl-web to fcl-base
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15158 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-base')
| -rw-r--r-- | packages/fcl-base/Makefile | 152 | ||||
| -rw-r--r-- | packages/fcl-base/Makefile.fpc | 2 | ||||
| -rw-r--r-- | packages/fcl-base/src/fptemplate.pp | 658 |
3 files changed, 749 insertions, 63 deletions
diff --git a/packages/fcl-base/Makefile b/packages/fcl-base/Makefile index 14b16af7c2..a11b0ffa27 100644 --- a/packages/fcl-base/Makefile +++ b/packages/fcl-base/Makefile @@ -1,8 +1,8 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/12/10] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/04/16] # default: all -MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux BSDs = freebsd netbsd openbsd darwin UNIXs = linux $(BSDs) solaris qnx haiku LIMIT83fs = go32v2 os2 emx watcom @@ -273,184 +273,187 @@ ifeq ($(OS_TARGET),win64) INSTALL_DATADIR=${INSTALL_UNITDIR} endif ifeq ($(FULL_TARGET),i386-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),i386-go32v2) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),i386-win32) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fileinfo syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fileinfo syncobjs fptimer endif ifeq ($(FULL_TARGET),i386-os2) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),i386-freebsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),i386-beos) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs endif ifeq ($(FULL_TARGET),i386-haiku) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs endif ifeq ($(FULL_TARGET),i386-netbsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fptimer endif ifeq ($(FULL_TARGET),i386-solaris) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),i386-qnx) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),i386-netware) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs endif ifeq ($(FULL_TARGET),i386-openbsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fptimer endif ifeq ($(FULL_TARGET),i386-wdosx) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),i386-darwin) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),i386-emx) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),i386-watcom) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),i386-netwlibc) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs endif ifeq ($(FULL_TARGET),i386-wince) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fileinfo syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fileinfo syncobjs fptimer endif ifeq ($(FULL_TARGET),i386-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),i386-symbian) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate +endif +ifeq ($(FULL_TARGET),i386-nativent) +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),m68k-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),m68k-freebsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),m68k-netbsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fptimer endif ifeq ($(FULL_TARGET),m68k-amiga) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),m68k-atari) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),m68k-openbsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fptimer endif ifeq ($(FULL_TARGET),m68k-palmos) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),m68k-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),powerpc-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),powerpc-netbsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fptimer endif ifeq ($(FULL_TARGET),powerpc-amiga) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),powerpc-macos) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),powerpc-darwin) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),powerpc-morphos) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),powerpc-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),sparc-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),sparc-netbsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fptimer endif ifeq ($(FULL_TARGET),sparc-solaris) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),sparc-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),x86_64-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),x86_64-freebsd) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),x86_64-solaris) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),x86_64-darwin) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),x86_64-win64) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fileinfo syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fileinfo syncobjs fptimer endif ifeq ($(FULL_TARGET),x86_64-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),arm-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),arm-palmos) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),arm-darwin) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),arm-wince) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fileinfo syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate fileinfo syncobjs fptimer endif ifeq ($(FULL_TARGET),arm-gba) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),arm-nds) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),arm-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),arm-symbian) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),powerpc64-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),powerpc64-darwin) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),powerpc64-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),avr-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),armeb-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),armeb-embedded) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate endif ifeq ($(FULL_TARGET),mipsel-linux) -override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 syncobjs fptimer +override TARGET_UNITS+=contnrs inifiles rtfpars idea base64 gettext iostream cachecls avl_tree uriparser eventlog custapp wformat whtml wtex rttiutils bufstream streamex blowfish streamio inicol pooledmm libtar streamcoll maskutils fpexprpars ascii85 fptemplate syncobjs fptimer endif ifeq ($(FULL_TARGET),i386-linux) override TARGET_RSTS+=cachecls custapp cgiapp eventlog registry streamcoll inicol @@ -512,6 +515,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override TARGET_RSTS+=cachecls custapp cgiapp eventlog registry streamcoll inicol endif +ifeq ($(FULL_TARGET),i386-nativent) +override TARGET_RSTS+=cachecls custapp cgiapp eventlog registry streamcoll inicol +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_RSTS+=cachecls custapp cgiapp eventlog registry streamcoll inicol endif @@ -699,6 +705,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override COMPILER_OPTIONS+=-S2h endif +ifeq ($(FULL_TARGET),i386-nativent) +override COMPILER_OPTIONS+=-S2h +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_OPTIONS+=-S2h endif @@ -879,6 +888,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src src/dummy endif +ifeq ($(FULL_TARGET),i386-nativent) +override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src src/dummy +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src src/dummy src/unix endif @@ -1059,6 +1071,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src endif +ifeq ($(FULL_TARGET),i386-nativent) +override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src endif @@ -1521,6 +1536,10 @@ ifeq ($(OS_TARGET),symbian) SHAREDLIBEXT=.dll SHORTSUFFIX=symbian endif +ifeq ($(OS_TARGET),NativeNT) +SHAREDLIBEXT=.dll +SHORTSUFFIX=nativent +endif else ifeq ($(OS_TARGET),go32v1) PPUEXT=.pp1 @@ -2007,6 +2026,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),i386-nativent) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),m68k-linux) REQUIRE_PACKAGES_RTL=1 endif @@ -2583,6 +2605,9 @@ fpc_zipdistinstall: ifdef EXEFILES override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) endif +ifdef CLEAN_PROGRAMS +override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS))) +endif ifdef CLEAN_UNITS override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS)) endif @@ -2630,6 +2655,9 @@ ifdef CLEANRSTFILES -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) endif endif +ifdef CLEAN_FILES + -$(DEL) $(CLEAN_FILES) +endif -$(DELTREE) units -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) ifneq ($(PPUEXT),.ppu) diff --git a/packages/fcl-base/Makefile.fpc b/packages/fcl-base/Makefile.fpc index 4120508942..16cd2e6aaa 100644 --- a/packages/fcl-base/Makefile.fpc +++ b/packages/fcl-base/Makefile.fpc @@ -14,7 +14,7 @@ units=contnrs inifiles rtfpars idea base64 gettext \ iostream cachecls avl_tree uriparser \ eventlog custapp wformat whtml wtex rttiutils bufstream \ streamex blowfish streamio inicol pooledmm libtar streamcoll \ - maskutils fpexprpars ascii85 + maskutils fpexprpars ascii85 fptemplate units_beos=syncobjs units_haiku=syncobjs units_freebsd=syncobjs fptimer diff --git a/packages/fcl-base/src/fptemplate.pp b/packages/fcl-base/src/fptemplate.pp new file mode 100644 index 0000000000..f1025ff3eb --- /dev/null +++ b/packages/fcl-base/src/fptemplate.pp @@ -0,0 +1,658 @@ +{ + $Id: header,v 1.1 2000/07/13 06:33:45 michael Exp $ + This file is part of the Free Component Library (FCL) + Copyright (c) 1999-2000 by the Free Pascal development team + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + 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. + + **********************************************************************} +{$mode objfpc} +{$H+} +{$define NOCONTNRS} +unit fpTemplate; + + +interface + +uses + SysUtils, + Classes; + +Const + DefaultParseDepth = 100; + MaxDelimLength = 5; + +Type + TParseDelimiter = String[MaxDelimLength]; + +Var + DefaultStartDelimiter : TParseDelimiter = '{'; //Template tag start |If you want Delphi-like, set it to '<#' + DefaultEndDelimiter : TParseDelimiter = '}'; //Template tag end | '>' + DefaultParamStartDelimiter : TParseDelimiter = '[-'; //Tag parameter start | ' ' + DefaultParamEndDelimiter : TParseDelimiter = '-]'; //Tag parameter end | '"' + DefaultParamValueSeparator : TParseDelimiter = '='; //Tag parameter name/value separator | '="' + // |for tags like <#TagName paramname1="paramvalue1" paramname2="paramvalue2"> + +Type + TGetParamEvent = Procedure(Sender : TObject; Const ParamName : String; Out AValue : String) Of Object; //for simple template tag support only (ex: {Name}) + TReplaceTagEvent = Procedure(Sender : TObject; Const TagString : String; TagParams:TStringList; Out ReplaceText : String) Of Object;//for tags with parameters support + + + { TTemplateParser } + + TTemplateParser = Class(TObject) + Private + FParseLevel : Integer; + FMaxParseDepth : Integer; + FEndDelimiter: TParseDelimiter; + FStartDelimiter: TParseDelimiter; + FParamStartDelimiter: TParseDelimiter; + FParamEndDelimiter: TParseDelimiter; + FParamValueSeparator: TParseDelimiter; + FAllowTagParams: Boolean; //default is false -> simple template tags allowed only [FValues, FOnGetParam (optional) used]; + //if true -> template tags with parameters allowed, [FOnReplaceTag] is used for all tag replacements + FRecursive: Boolean; //when only simple tags are used in a template (AllowTagParams=false), the replacement can + FValues : TStringList; //contain further tags for recursive processing (only used when no tag params are allowed) + FOnGetParam: TGetParamEvent; //Event handler to use for templates containing simple tags only (ex: {Name}) + FOnReplaceTag: TReplaceTagEvent; //Event handler to use for templates containing tags with parameters (ex: <#TagName paramname1="paramvalue1" paramname2="paramvalue2">) + function GetDelimiter(Index: integer): TParseDelimiter; + function GetValue(Key : String): String; + procedure SetDelimiter(Index: integer; const AValue: TParseDelimiter); + procedure SetValue(Key : String; const AValue: String); + Public + Constructor Create; + Destructor Destroy; override; + Procedure Clear; + Function ReplaceTag(const Key: String; TagParams:TStringList; out ReplaceWith: String): Boolean;//used only when AllowTagParams = true + Function GetParam(Const Key : String; Out AValue : String) : Boolean; //used only when AllowTagParams = false + Procedure GetTagParams(var TagName:String; var TagParams : TStringList) ; + Function ParseString(Src : String) : String; + Function ParseStream(Src : TStream; Dest : TStream) : Integer; // Wrapper, Returns number of bytes written. + Procedure ParseStrings(Src : TStrings; Dest : TStrings) ; // Wrapper + Property OnGetParam : TGetParamEvent Read FOnGetParam Write FOnGetParam; // Called if not found in values //used only when AllowTagParams = false + Property OnReplaceTag : TReplaceTagEvent Read FOnReplaceTag Write FOnReplaceTag; // Called if a tag found //used only when AllowTagParams = true + Property StartDelimiter : TParseDelimiter Index 1 Read GetDelimiter Write SetDelimiter;// Start char/string, default '}' + Property EndDelimiter : TParseDelimiter Index 2 Read GetDelimiter Write SetDelimiter; // end char/string, default '{' + Property ParamStartDelimiter : TParseDelimiter Index 3 Read GetDelimiter Write SetDelimiter; + Property ParamEndDelimiter : TParseDelimiter Index 4 Read GetDelimiter Write SetDelimiter; + Property ParamValueSeparator : TParseDelimiter Index 5 Read GetDelimiter Write SetDelimiter; + Property Values[Key : String] : String Read GetValue Write SetValue; // Contains static values. //used only when AllowTagParams = false + Property Recursive : Boolean Read FRecursive Write FRecursive; //used only when AllowTagParams = false + Property AllowTagParams : Boolean Read FAllowTagParams Write FAllowTagParams; + end; + + { TFPCustomTemplate } + + TFPCustomTemplate = Class(TPersistent) + private + FEndDelimiter: TParseDelimiter; + FStartDelimiter: TParseDelimiter; + FParamStartDelimiter: TParseDelimiter; + FParamEndDelimiter: TParseDelimiter; + FParamValueSeparator: TParseDelimiter; + FFileName: String; + FTemplate: String; + FOnGetParam: TGetParamEvent; //used only when AllowTagParams = false + FOnReplaceTag: TReplaceTagEvent; //used only when AllowTagParams = true + FAllowTagParams: Boolean; + Protected + Procedure GetParam(Sender : TObject; Const ParamName : String; Out AValue : String);virtual; //used only when AllowTagParams = false + Procedure ReplaceTag(Sender : TObject; Const TagName: String; TagParams:TStringList; Out AValue: String);virtual; //used only when AllowTagParams = true + Function CreateParser : TTemplateParser; virtual; + Public + Function HasContent : Boolean; + Function GetContent : String; + Procedure Assign(Source : TPersistent); override; + Property StartDelimiter : TParseDelimiter Read FStartDelimiter Write FStartDelimiter; + Property EndDelimiter : TParseDelimiter Read FEndDelimiter Write FEndDelimiter; + Property ParamStartDelimiter : TParseDelimiter Read FParamStartDelimiter Write FParamStartDelimiter; + Property ParamEndDelimiter : TParseDelimiter Read FParamEndDelimiter Write FParamEndDelimiter; + Property ParamValueSeparator : TParseDelimiter Read FParamValueSeparator Write FParamValueSeparator; + Property FileName : String Read FFileName Write FFileName; + Property Template : String Read FTemplate Write FTemplate; + Property OnGetParam : TGetParamEvent Read FOnGetParam Write FOnGetParam; + Property OnReplaceTag : TReplaceTagEvent Read FOnReplaceTag Write FOnReplaceTag; + Property AllowTagParams : Boolean Read FAllowTagParams Write FAllowTagParams; + end; + + TFPTemplate = Class(TFPCustomTemplate) + Published + Property FileName; + Property Template; +// Property AllowTagParams; +// Property OnReplaceTag; + end; + + ETemplateParser = Class(Exception); + +Var + MaxParseDepth : Integer = DefaultParseDepth; + + +implementation + +Resourcestring + SErrParseDepthExceeded = 'Maximum parse level (%d) exceeded.'; + SErrNoEmptyDelimiters = 'Delimiters cannot be empty'; + +{ TTemplateParser } +Type + + { TStringItem } + + TStringItem = Class(TObject) + Private + FValue : String; + Public + Constructor Create(AValue : String); + Property Value : String Read FValue Write FValue; + end; + +{ TStringItem } + +constructor TStringItem.Create(AValue: String); +begin + FValue:=AValue; +end; + +{ TTemplateParser } + +function TTemplateParser.GetValue(Key : String): String; + +Var + I : Integer; + +begin + Result:=''; + If Assigned(FValues) then + begin + I:=FValues.IndexOf(Key); + If (I<>-1) then + Result:=TStringItem(FValues.Objects[i]).Value; + end; +end; + +function TTemplateParser.GetDelimiter(Index: integer): TParseDelimiter; +begin + case Index of + 1: Result:=FStartDelimiter; + 2: Result:=FEndDelimiter; + 3: Result:=FParamStartDelimiter; + 4: Result:=FParamEndDelimiter; + else + Result:=FParamValueSeparator; + end; +end; + +procedure TTemplateParser.SetDelimiter(Index: integer; + const AValue: TParseDelimiter); +begin + If Length(AValue)=0 then + Raise ETemplateParser.Create(SErrNoEmptyDelimiters); + case Index of + 1: FStartDelimiter:=AValue; + 2: FEndDelimiter:=AValue; + 3: FParamStartDelimiter:=AValue; + 4: FParamEndDelimiter:=AValue; + else + FParamValueSeparator:=AValue; + end; + +end; + +procedure TTemplateParser.SetValue(Key : String; const AValue: String); + +Var + I : Integer; + +begin + If (AValue='') then + begin + If Assigned(FValues) then + begin + I:=FValues.IndexOf(Key); + If (I<>-1) then + begin + FValues.Objects[i].Free; + FValues.Delete(I); + end; + end; + end + else + begin + if Not Assigned(FValues) then + begin + FVAlues:=TStringList.Create; + FValues.Sorted:=True; + end; + I:=FValues.IndexOf(Key); + If (I=-1) then + FValues.AddObject(Key,TStringItem.Create(AValue)) + else + TStringItem(FValues.Objects[I]).Value:=AValue; + end; +end; + +constructor TTemplateParser.Create; + +begin + FParseLevel:=0; + FMaxParseDepth:=MaxParseDepth; + FStartDelimiter:=DefaultStartDelimiter; + FEndDelimiter:=DefaultEndDelimiter; + FParamStartDelimiter:=DefaultParamStartDelimiter; + FParamEndDelimiter:=DefaultParamEndDelimiter; + FParamValueSeparator:=DefaultParamValueSeparator; + FAllowTagParams := false; +end; + +destructor TTemplateParser.Destroy; + +begin + Clear; + inherited Destroy; +end; + +procedure TTemplateParser.Clear; + +Var + I : Integer; + +begin + If Assigned(FValues) then + For I:=0 to FValues.Count-1 do + FValues.Objects[i].Free; + FreeAndNil(FValues); +end; + +function TTemplateParser.GetParam(const Key: String; out AValue: String): Boolean; + +Var + I : Integer; + +begin + If Assigned(FValues) then + I:=FValues.IndexOf(Key) + else + I:=-1; + Result:=(I<>-1); + If Result then + AValue:=TStringItem(FValues.Objects[i]).Value + else + begin + Result:=Assigned(FOnGetParam); + If Result then + FOnGetParam(Self,Key,AValue); + end; + If Result and Recursive then + AValue:=ParseString(AValue); +end; + +function TTemplateParser.ReplaceTag(const Key: String; TagParams:TStringList; out ReplaceWith: String): Boolean; +begin + Result:=Assigned(FOnReplaceTag); + If Result then + FOnReplaceTag(Self,Key,TagParams,ReplaceWith); +end; + +Function FindDelimiter(SP : PChar; D : TParseDelimiter; MaxLen : Integer) : PChar; Inline; + +Var + P,P2 : PChar; + I,DLen : Integer; + +begin + Result:=Nil; + DLen:=Length(D); + Dec(MaxLen,(DLen-1)); + If MaxLen<=0 then + exit; + P:=SP; + While (Result=Nil) and (P-SP<=MaxLen) do + begin + While (P-SP<=MaxLen) and (P^<>D[1]) do + Inc(P); + If ((P-SP)<=MaxLen) then + begin + Result:=P; + P2:=P+1; + // Check Other characters + I:=2; + While (I<=DLen) and (Result<>Nil) do + If (P2^=D[i]) then + begin + inc(i); + Inc(p2); + end + else + begin + P:=Result; + Result:=Nil; + end; + // Either result<>Nil -> match or result=nil -> no match + inc(P); + end; + end; +end; + +Procedure AddToString(Var S : String; P : PChar; NChars : Integer);inline; + +Var + SLen : Integer; + +begin + SLen:=Length(S); + SetLength(S,SLen+NChars); + Move(P^,S[Slen+1],NChars); +end; + +procedure TTemplateParser.GetTagParams(var TagName:String; var TagParams : TStringList) ; +var + I,SLen:Integer; + TS,TM,TE,SP,P : PChar; + PName, PValue, TP : String; + IsFirst:Boolean; +begin + SLen:=Length(TagName); + if SLen=0 then exit; + + IsFirst := true; + SP:=PChar(TagName); + TP := TagName; + P:=SP; + while (P-SP<SLen) do + begin + TS:=FindDelimiter(P,FParamStartDelimiter,SLen-(P-SP)); + if (TS<>Nil) then + begin//Found param start delimiter + if IsFirst then + begin//Get the real Tag name + IsFirst := false; + I := 1; + while not (P[I] in [#0..' ']) do Inc(I); + SetLength(TP, I); + Move(P^, TP[1], I); + end; + inc(TS, Length(FParamStartDelimiter)); + I:=TS-P;//index of param name + TM:=FindDelimiter(TS,FParamValueSeparator,SLen-I+1); + if (TM<>Nil) then + begin//Found param value separator + I:=TM-TS;//lenght of param name + SetLength(PName, I); + Move(TS^, PName[1], I);//param name + inc(TS, Length(FParamValueSeparator) + I); + I := TS - P;//index of param value + TE:=FindDelimiter(TS,FParamEndDelimiter, SLen-I+1); + if (TE<>Nil) then + begin//Found param end + I:=TE-TS;//Param length + Setlength(PValue,I); + Move(TS^,PValue[1],I);//Param value + TagParams.Add(Trim(PName) + '=' + PValue);//Param names cannot contain '=' + P:=TE+Length(FParamEndDelimiter); + TS:=P; + end else break; + end else break; + end else break; + end; + TagName := Trim(TP); +end; + +function TTemplateParser.ParseString(Src: String): String; + +Var + PN,PV,ReplaceWith : String; + i,SLen : Integer; + TS,TE,SP,P : PChar; + TagParams:TStringList; +begin + if FAllowTagParams then + begin//template tags with parameters are allowed + SLen:=Length(Src); + If SLen=0 then + exit; + Result:=''; + SP:=PChar(Src); + P:=SP; + While (P-SP<SLen) do + begin + TS:=FindDelimiter(P,FStartDelimiter,SLen-(P-SP)); + If (TS=Nil) then + begin//Tag Start Delimiter not found + TS:=P; + P:=SP+SLen; + end + else + begin + I:=TS-P; + TE:=FindDelimiter(TS,FEndDelimiter,SLen-I+1); + If (TE=Nil) then + begin//Tag End Delimiter not found + TS:=P; + P:=SP+SLen; + end + else//Found start and end delimiters for the Tag + begin + // Add text prior to template tag to result + AddToString(Result,P,I); + // Retrieve the full template tag (only tag name if no params specified) + inc(TS,Length(FStartDelimiter));//points to first char of Tag name now + I:=TE-TS;//full Tag length + Setlength(PN,I); + Move(TS^,PN[1],I);//full Tag string (only tag name if no params specified) + TagParams := TStringList.Create; + try + TagParams.Sorted := True; + GetTagParams(PN, Tagparams); + If ReplaceTag(PN,TagParams,ReplaceWith) then + Result:=Result+ReplaceWith; + finally + TagParams.Free; + end; + P:=TE+Length(FEndDelimiter); + TS:=P; + end; + end + end; + I:=P-TS; + If (I>0) then + AddToString(Result,TS,I); + end else begin//template tags with parameters are not allowed + Inc(FParseLevel); + If FParseLevel>FMaxParseDepth then + Raise ETemplateParser.CreateFmt(SErrParseDepthExceeded,[FMaxParseDepth]); + SLen:=Length(Src); // Minimum + If SLen=0 then + exit; +// STLen:=Length(FStartDelimiter); + Result:=''; + SP:=PChar(Src); + P:=SP; + While (P-SP<SLen) do + begin + TS:=FindDelimiter(P,FStartDelimiter,SLen-(P-SP)); + If (TS=Nil) then + begin + TS:=P; + P:=SP+SLen + end + else + begin + I:=TS-P; + TE:=FindDelimiter(TS,FEndDelimiter,SLen-I+1); + If (TE=Nil) then + begin + TS:=P; + P:=SP+SLen; + end + else + begin + // Add text prior to template to result + AddToString(Result,P,I); + // retrieve template name + inc(TS,Length(FStartDelimiter)); + I:=TE-TS; + Setlength(PN,I); + Move(TS^,PN[1],I); + If GetParam(PN,PV) then + begin + Result:=Result+PV; + end; + P:=TE+Length(FEndDelimiter); + TS:=P; + end; + end + end; + I:=P-TS; + If (I>0) then + AddToString(Result,TS,I); + end; +end; + +function TTemplateParser.ParseStream(Src: TStream; Dest: TStream): Integer; + +Var + SS : TStringStream; + S,R : String; + +begin + SS:=TStringStream.Create(''); + Try + SS.CopyFrom(Src,0); + S:=SS.DataString; + Finally + SS.Free; + end; + FParseLevel := 0; + R:=ParseString(S); + Result:=Length(R); + If (Result>0) then + Dest.Write(R[1],Result); +end; + +procedure TTemplateParser.ParseStrings(Src: TStrings; Dest: TStrings); + +Var + I : Integer; + +begin + For I:=0 to Src.Count-1 do + begin + FParseLevel := 0; + Dest.Add(ParseString(Src[i])); + end; +end; + +{ TFPCustomTemplate } + +procedure TFPCustomTemplate.GetParam(Sender: TObject; const ParamName: String; out AValue: String); + +begin + If Assigned(FOnGetParam) then + FOnGetParam(Self,ParamName,AValue); +end; + +procedure TFPCustomTemplate.ReplaceTag(Sender: TObject; const TagName: String; TagParams:TStringList; Out AValue: String); + +begin + If Assigned(FOnReplaceTag) then + begin + FOnReplaceTag(Self,TagName,TagParams,AValue); + end; +end; + +function TFPCustomTemplate.CreateParser: TTemplateParser; + +begin + Result:=TTemplateParser.Create; + Result.FParseLevel := 0; + If (FStartDelimiter<>'') then + Result.StartDelimiter:=FStartDelimiter; + If (FEndDelimiter<>'') then + Result.EndDelimiter:=FEndDelimiter; + If (FParamStartDelimiter<>'') then + Result.ParamStartDelimiter:=FParamStartDelimiter; + If (FParamEndDelimiter<>'') then + Result.ParamEndDelimiter:=FParamEndDelimiter; + If (FParamValueSeparator<>'') then + Result.ParamValueSeparator:=FParamValueSeparator; + Result.OnGetParam:=@GetParam; + Result.OnReplaceTag:=@ReplaceTag; + Result.AllowTagParams:=FAllowTagParams; +end; + +function TFPCustomTemplate.HasContent: Boolean; + +begin + Result:=(FTemplate<>'') or (FFileName<>''); +end; + +function TFPCustomTemplate.GetContent: String; + +Var + P : TTemplateParser; + S : TStringStream; + F : TFileStream; + +begin + F:=Nil; + S:=Nil; + If HasContent then + begin + if (FFileName<>'') then + begin + F:=TFileStream.Create(FFileName,fmOpenRead); + S:=TStringStream.Create(''); + end; + Try + P:=CreateParser; + Try + If (F<>Nil) then + begin + P.ParseStream(F,S); + Result:=S.DataString; + end + else + Result:=P.ParseString(FTemplate); + Finally + P.Free; + end; + Finally + F.Free; + S.Free; + end; + end; +end; + +procedure TFPCustomTemplate.Assign(Source: TPersistent); + +Var + T : TFPCustomTemplate; + +begin + If Source is TFPCustomTemplate then + begin + T:=Source as TFPCustomTemplate; + FEndDelimiter:=T.EndDelimiter; + FStartDelimiter:=T.StartDelimiter; + FParamEndDelimiter:=T.ParamEndDelimiter; + FParamStartDelimiter:=T.ParamStartDelimiter; + FParamValueSeparator:=T.ParamValueSeparator; + FFileName:=T.FileName; + FTemplate:=T.Template; + FOnGetParam:=T.OnGetParam; + FOnReplaceTag:=T.OnReplaceTag; + FAllowTagParams := T.AllowTagParams; + end + else + inherited Assign(Source); +end; + +end. + |
