From eed0938b23d13ec4f2ef4588ccdb2e7abc0c1552 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 29 Mar 2020 18:29:44 -0400 Subject: 0.10.0 search sqlite & cgi --- src/doc_reform/io_out/paths_output.d | 60 +++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) (limited to 'src/doc_reform/io_out/paths_output.d') diff --git a/src/doc_reform/io_out/paths_output.d b/src/doc_reform/io_out/paths_output.d index 7cd9051..c7148a6 100644 --- a/src/doc_reform/io_out/paths_output.d +++ b/src/doc_reform/io_out/paths_output.d @@ -44,6 +44,22 @@ template spineOutPathSQLite() { return _PathsStruct(); } } +template spineOutPathSQLiteCGI() { + auto spineOutPathSQLiteCGI(Po)( + Po output_pth_root, + ) { + struct _PathsStruct { + string output_root() { + return (output_pth_root.length > 0) + ? output_pth_root : ""; + } + string output_base() { + return ((output_root).asNormalizedPath).array; + } + } + return _PathsStruct(); + } +} template spineOutPathsFnPd() { /+ TODO stuff to work out here +/ auto spineOutPathsFnPd(Fn,Pn)( @@ -535,9 +551,9 @@ template spinePathsSQLiteDiscrete() { template spinePathsSQLite() { mixin spineRgxIn; static auto rgx = RgxI(); - auto spinePathsSQLite(DbN, Po)( - DbN db_name, - Po output_pth_root, + auto spinePathsSQLite()( + string db_name, + string output_pth_root, ) { struct _PathsStruct { string base_filename(string fn_src) { @@ -549,7 +565,43 @@ template spinePathsSQLite() { return (((out_pth.output_root).chainPath(base_dir)).asNormalizedPath).array; } string sqlite_file() { - return ((base.chainPath(base_filename(db_name) ~ ".sql.db")).asNormalizedPath).array; + return (base.chainPath(db_name).asNormalizedPath).array; + } + } + return _PathsStruct(); + } +} +template spinePathsSQLiteCGI() { + mixin spineRgxIn; + static auto rgx = RgxI(); + auto spinePathsSQLiteCGI()( + string cgi_search_form_d, + string cgi_search_form, + string output_pth_root, + ) { + struct _PathsStruct { + string base_filename(string fn_src) { + return fn_src.baseName.stripExtension; + } + string base() { + auto out_pth = spineOutPathSQLiteCGI!()(output_pth_root); + string base_dir = "cgi"; + return (((out_pth.output_root).chainPath(base_dir)).asNormalizedPath).array; + } + string src() { + return ((base.chainPath("src")).asNormalizedPath).array; + } + string cgi_bin() { + return ((base.chainPath("cgi-bin")).asNormalizedPath).array; + } + string dub_sdl_path_out() { + return ((base.chainPath("dub.sdl")).asNormalizedPath).array; + } + string search_form_dub_path() { + return ("src/".chainPath(base_filename(cgi_search_form_d)).asNormalizedPath).array; + } + string search_form_path_out() { + return (src.chainPath((cgi_search_form_d)).asNormalizedPath).array; } } return _PathsStruct(); -- cgit v1.2.3