aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_paths.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2020-03-29 18:29:44 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2020-05-20 11:27:23 -0400
commiteed0938b23d13ec4f2ef4588ccdb2e7abc0c1552 (patch)
tree4e015ce076795100792412b76156330e80440c37 /org/default_paths.org
parentmeson using dub (diff)
0.10.0 search sqlite & cgi
Diffstat (limited to 'org/default_paths.org')
-rw-r--r--org/default_paths.org66
1 files changed, 62 insertions, 4 deletions
diff --git a/org/default_paths.org b/org/default_paths.org
index 0e80bb2..789d94e 100644
--- a/org/default_paths.org
+++ b/org/default_paths.org
@@ -1029,6 +1029,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();
+ }
+}
#+END_SRC
** set
@@ -1575,9 +1591,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) {
@@ -1589,7 +1605,49 @@ 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();
+ }
+}
+#+END_SRC
+
+*** TODO cgi search form
+
+#+NAME: template_paths_sqlite
+#+BEGIN_SRC d
+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();