aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output/paths_source.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/output/paths_source.d')
-rw-r--r--src/sdp/output/paths_source.d54
1 files changed, 53 insertions, 1 deletions
diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d
index c420d7e..d04c9f6 100644
--- a/src/sdp/output/paths_source.d
+++ b/src/sdp/output/paths_source.d
@@ -151,6 +151,7 @@ template PathMatters() {
return Pod_();
}
auto src() {
+ string _sep = "␣";
struct SRC_ {
auto is_pod() {
auto _src_is_pod = (_manifest.pod_manifest_path.length > 0) ? true : false;
@@ -159,19 +160,70 @@ template PathMatters() {
auto path_and_fn() {
return _fns;
}
+ auto pod_name() { /+ work on +/
+ auto _pod_name = (is_pod)
+ ? _manifest.pod_manifest_path
+ : "";
+ return _pod_name;
+ }
auto filename() {
auto _fn = (path_and_fn).baseName;
return _fn;
}
+ auto filename_base() {
+ auto _fn = filename.stripExtension;
+ return _fn;
+ }
+ auto filename_extension() {
+ auto _ext = filename.match(rgx.src_pth_sst_or_ssm).captures["extension"];
+ return _ext;
+ }
auto lng() {
string _k;
- if (auto m = (path_and_fn).match(rgx.language_code_and_filename)) {
+ if (auto m = path_and_fn.match(rgx.language_code_and_filename)) {
_k = m.captures[1];
} else {
_k = "en";
}
return _k;
}
+ auto docname_composite_unique_per_src_doc() {
+ /+
+ z pod name if any + src filename + lng code
+ filename ~ "." ~ lng
+ * unique per src doc
+ used by
+ - sqlite discrete index (multilingual, each language of a document)
+ +/
+ string _fn;
+ if (pod_name.baseName == filename_base) {
+ _fn = filename_base ~ _sep ~ filename_extension ~ _sep ~ lng;
+ } else if (!(pod_name.empty)) {
+ _fn = pod_name.baseName ~ _sep ~ filename_base ~ _sep ~ filename_extension ~ _sep ~ lng;
+ } else {
+ _fn = "_" ~ _sep ~ filename_base ~ _sep ~ filename_extension ~ _sep ~ lng;
+ }
+ return _fn;
+ }
+ auto docname_composite_unique_per_src_pod() {
+ /+
+ z pod name if any + src filename (without lng code)
+ filename ~ _sep ~ lng
+ * unique per src pod
+ used by
+ - sisupod (multilingual collection)
+ - sqlite discrete index (multilingual collection)
+ +/
+ string _fn;
+ if (pod_name.baseName == filename_base) {
+ _fn = filename_base ~ _sep ~ filename_extension;
+ } else if (!(pod_name.empty)) {
+ _fn = pod_name.baseName ~ _sep ~ filename_base ~ _sep ~ filename_extension;
+ } else {
+ _fn = "_" ~ _sep ~ filename_base ~ _sep ~ filename_extension;
+ }
+ return _fn;
+ }
auto language() {
return lng();
}