aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output/paths_output.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-04-14 16:39:52 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit479e71e90146b1067120faf489af1b13a5a0cf3d (patch)
tree5e725994ae345dd89687fae2fe90979eb3cf6f8d /src/sdp/output/paths_output.d
parent0.26.0 sqlite single statement insertion of objects (diff)
sqlite3 some stuff & rearrange files, dlang, org
Diffstat (limited to 'src/sdp/output/paths_output.d')
-rw-r--r--src/sdp/output/paths_output.d42
1 files changed, 30 insertions, 12 deletions
diff --git a/src/sdp/output/paths_output.d b/src/sdp/output/paths_output.d
index d58b990..cd4817b 100644
--- a/src/sdp/output/paths_output.d
+++ b/src/sdp/output/paths_output.d
@@ -29,12 +29,32 @@ template SiSUoutPaths() {
return _PathsStruct();
}
}
+template SiSUoutPathSQLite() {
+ auto SiSUoutPathSQLite(Po)(
+ Po output_pth_root,
+ ) {
+ struct _PathsStruct {
+ string output_root() {
+ string out_root_;
+ if (output_pth_root.length > 0) {
+ out_root_ = output_pth_root;
+ } else {
+ out_root_ = "sisugen";
+ }
+ return out_root_;
+ }
+ string output_base() {
+ return asNormalizedPath(output_root).array;
+ }
+ }
+ return _PathsStruct();
+ }
+}
template SiSUoutPathsFnPd() {
/+ TODO stuff to work out here +/
auto SiSUoutPathsFnPd(Fn,Pn)(
Fn fn_src_pth,
Pn pod_name
- // Pn pod_name = "",
) {
struct _PathsStruct {
string base_filename() {
@@ -216,14 +236,16 @@ template SiSUpathsSQLiteDiscrete() {
Po output_pth_root,
Lng lng,
) {
- auto out_pth = SiSUoutPaths!()(output_pth_root, lng);
- string base_dir = "sqlite";
struct _PathsStruct {
string base_filename(string fn_src) {
return fn_src.baseName.stripExtension;
}
string base() {
- return asNormalizedPath((out_pth.output_root).chainPath(base_dir)).array;
+ auto out_pth = SiSUoutPaths!()(output_pth_root, lng);
+ string base_dir = "sqlite";
+ return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;
+ // return asNormalizedPath((out_pth.output_root).chainPath(base_dir)).array; // single file for each file, multiple languages
+ // return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array; // separate files for each language
}
string seg(string fn_src) {
return asNormalizedPath(base.chainPath(base_filename(fn_src))).array;
@@ -238,23 +260,19 @@ template SiSUpathsSQLiteDiscrete() {
template SiSUpathsSQLite() {
mixin SiSUrgxInit;
static auto rgx = Rgx();
- auto SiSUpathsSQLite(Po,Lng)(
+ auto SiSUpathsSQLite(Po)(
Po output_pth_root,
- Lng lng,
) {
- auto out_pth = SiSUoutPaths!()(output_pth_root, lng);
- string base_dir = "sqlite";
struct _PathsStruct {
string base_filename(string fn_src) {
return fn_src.baseName.stripExtension;
}
string base() {
+ auto out_pth = SiSUoutPathSQLite!()(output_pth_root); // decide whether to have separate files for each language
+ string base_dir = "sqlite";
return asNormalizedPath((out_pth.output_root).chainPath(base_dir)).array;
}
- string seg(string fn_src) {
- return asNormalizedPath(base.chainPath(base_filename(fn_src))).array;
- }
- string sqlite_file(string fn_src) {
+ string sqlite_file(string fn_src = "sdp-niu") {
return asNormalizedPath(base.chainPath(base_filename(fn_src) ~ ".sqlite")).array;
}
}