aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/io_in/read_source_files.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/io_in/read_source_files.d')
-rw-r--r--src/sisudoc/io_in/read_source_files.d35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/sisudoc/io_in/read_source_files.d b/src/sisudoc/io_in/read_source_files.d
index 34ec9a9..80b3d71 100644
--- a/src/sisudoc/io_in/read_source_files.d
+++ b/src/sisudoc/io_in/read_source_files.d
@@ -88,18 +88,20 @@ template spineRawMarkupContent() {
char[][] src_txt;
string[] insert_files;
string[] images;
- ubyte[32] header_digest;
- ubyte[32] src_txt_digest;
+ }
+ struct ST_doc_digest {
+ ubyte[32] markup_doc;
+ ubyte[32] header;
+ ubyte[32] text;
}
struct ST_doc_parts {
- char[] header_raw;
- char[][] sourcefile_body_content;
- string[] insert_file_list;
- string[] images_list;
- ubyte[32] header_raw_digest;
- ubyte[32] src_txt_digest;
+ char[] header_raw;
+ char[][] sourcefile_body_content;
+ string[] insert_file_list;
+ string[] images_list;
+ ST_doc_digest doc_digest;
}
- auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) {
+ ST_doc_parts spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) {
ST_doc_parts _0_header_1_body_content_2_insert_filelist_struct
= rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src);
return _0_header_1_body_content_2_insert_filelist_struct;
@@ -122,7 +124,6 @@ template spineRawMarkupContent() {
ST_header_content_inserts_images st
= raw.markupSourceHeaderContentRawLineStructArray(source_txt_str);
char[] header_raw = st.header;
- ubyte[32] header_raw_digest = st.header.sha256Of;
char[][] sourcefile_body_content = st.src_txt;
if (fn_src.match(rgx_files.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise
auto ins = Inserts();
@@ -137,16 +138,20 @@ template spineRawMarkupContent() {
= ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src);
images_list_get = _cii.images.dup;
} // image_list, if path could take sha256 digests already here?
- ubyte[32] src_txt_digest = sourcefile_body_content.sha256Of;
string header_type = "";
+ ST_doc_digest dig;
+ {
+ dig.markup_doc = source_txt_str.sha256Of;
+ dig.header = st.header.sha256Of;
+ dig.text = sourcefile_body_content.sha256Of;
+ }
ST_doc_parts ret;
{
ret.header_raw = st.header;
ret.sourcefile_body_content = sourcefile_body_content;
ret.insert_file_list = insert_file_list_get;
ret.images_list = images_list_get;
- ret.header_raw_digest = st.header.sha256Of;
- ret.src_txt_digest = sourcefile_body_content.sha256Of;
+ ret.doc_digest = dig;
}
return ret;
}
@@ -213,16 +218,12 @@ template spineRawMarkupContent() {
char[] header = hc[0];
char[] source_txt = hc[1];
char[][] source_line_arr = markupSourceLineArray(source_txt);
- ubyte[32] header_digest;
- ubyte[32] src_txt_digest;
ST_header_content_inserts_images ret;
{
ret.header = header;
ret.src_txt = source_line_arr;
ret.insert_files = file_insert_list;
ret.images = images_list;
- ret.header_digest = header_digest;
- ret.src_txt_digest = src_txt_digest;
}
return ret;
}