diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-05-14 11:35:24 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-08-19 14:42:43 -0400 |
commit | 24c9ed3645178a6ee2abbd9201fa4643dba068e2 (patch) | |
tree | 37cd2dbe489d8ab850fd814cdec63004c9a3150c /src/doc_reform/output/sqlite.d | |
parent | doc_abstraction reduce use of return ref, check (diff) |
review, reduce use of auto
Diffstat (limited to 'src/doc_reform/output/sqlite.d')
-rw-r--r-- | src/doc_reform/output/sqlite.d | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/src/doc_reform/output/sqlite.d b/src/doc_reform/output/sqlite.d index 832e2e7..57c90e0 100644 --- a/src/doc_reform/output/sqlite.d +++ b/src/doc_reform/output/sqlite.d @@ -11,17 +11,17 @@ static auto rgx = Rgx(); long _metadata_tid_lastrowid; template SQLiteHubBuildTablesAndPopulate() { void SQLiteHubBuildTablesAndPopulate(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { auto pth_sqlite = DocReformPathsSQLite!()(doc_matters.sqlite.filename, doc_matters.output_path); pth_sqlite.base.mkdirRecurse; auto db = Database(pth_sqlite.sqlite_file); template SQLiteDbStatementComposite() { void SQLiteDbStatementComposite(Db,D,M)( - Db db, - D doc_abstraction, - M doc_matters, + Db db, + const D doc_abstraction, + M doc_matters, ) { { string _db_statement; @@ -58,17 +58,17 @@ template SQLiteHubBuildTablesAndPopulate() { } template SQLiteHubDiscreteBuildTablesAndPopulate() { void SQLiteHubDiscreteBuildTablesAndPopulate(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { auto pth_sqlite = DocReformPathsSQLiteDiscrete!()(doc_matters.output_path, doc_matters.src.language); pth_sqlite.base.mkdirRecurse; auto db = Database(pth_sqlite.sqlite_file(doc_matters.src.filename)); template SQLiteDiscreteDbStatementComposite() { void SQLiteDiscreteDbStatementComposite(Db,D,M)( - Db db, - D doc_abstraction, - M doc_matters, + Db db, + const D doc_abstraction, + M doc_matters, ) { { string _db_statement; @@ -137,7 +137,7 @@ template SQLiteFormatAndLoadObject() { ) { mixin DocReformOutputRgxInit; struct sqlite_format_and_load_objects { - auto generic_munge_sanitize_text_for_search( + string generic_munge_sanitize_text_for_search( string _txt, ) { string _notes; @@ -173,9 +173,9 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - auto munge_html(M,O)( - M doc_matters, - auto ref const O obj, + string munge_html(M,O)( + M doc_matters, + const O obj, ) { string _html_special_characters(string _txt){ _txt = _txt @@ -254,7 +254,7 @@ template SQLiteFormatAndLoadObject() { .replaceAll(rgx.inline_cite, "<cite>$1</cite>"); return _txt; } - auto inline_images(M,O)( + string inline_images(M,O)( M doc_matters, const O obj, string _txt, @@ -278,7 +278,7 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - auto inline_links(M,O)( + string inline_links(M,O)( M doc_matters, const O obj, string _txt, @@ -379,7 +379,7 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - auto inline_notes_scroll(M,O)( + string inline_notes_scroll(M,O)( M doc_matters, const O obj, string _txt, @@ -443,7 +443,7 @@ template SQLiteFormatAndLoadObject() { return t; } string xml_type="seg"; /+ set html document type to be linked to here (seg|scroll) +/ - auto inline_markup(M,O)( + string inline_markup(M,O)( M doc_matters, const O obj, string _txt, @@ -453,9 +453,9 @@ template SQLiteFormatAndLoadObject() { _txt = inline_notes_scroll(doc_matters, obj, _txt); return _txt; } - auto html_heading(M,O)( - M doc_matters, - auto ref const O obj, + string html_heading(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -471,9 +471,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_para(M,O)( - M doc_matters, - auto ref const O obj, + string html_para(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -492,9 +492,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_quote(M,O)( - M doc_matters, - auto ref const O obj, + string html_quote(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -509,9 +509,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_group(M,O)( - M doc_matters, - auto ref const O obj, + string html_group(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -526,9 +526,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_block(M,O)( - M doc_matters, - auto ref const O obj, + string html_block(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -542,9 +542,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_verse(M,O)( - M doc_matters, - auto ref const O obj, + string html_verse(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -557,8 +557,8 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_code(O)( - auto ref const O obj, + string html_code(O)( + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); @@ -571,17 +571,17 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_table(M,O)( - M doc_matters, - auto ref const O obj, + string html_table(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "table"); auto _tablarize(O)( - auto ref const O obj, - string _txt, + const O obj, + string _txt, ) { string[] _table_rows = _txt.split(rgx.table_delimiter_row); string[] _table_cols; @@ -636,24 +636,24 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto sqlite_load_string(M,O)( - auto ref M doc_matters, - auto ref const O obj, + string sqlite_load_string(M,O)( + M doc_matters, + const O obj, ) { string o; return o; } - auto postgresql_load_string(M,O)( - auto ref M doc_matters, - auto ref const O obj, + string postgresql_load_string(M,O)( + M doc_matters, + const O obj, ) { string o; return o; } string sqlite_statement(O)( - auto ref const O obj, - string _txt, - string _html, + const O obj, + string _txt, + string _html, ) { void _sql_exe(O)( string _sql, @@ -664,9 +664,9 @@ template SQLiteFormatAndLoadObject() { string _sql; return _sql; } - auto heading(M,O)( - M doc_matters, - auto ref const O obj, + string[string] heading(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -687,9 +687,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto para(M,O)( - M doc_matters, - auto ref const O obj, + string[string] para(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -710,9 +710,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto quote(M,O)( - M doc_matters, - auto ref const O obj, + string[string] quote(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -733,9 +733,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto group(M,O)( - M doc_matters, - auto ref const O obj, + string[string] group(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -756,9 +756,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto block(M,O)( - M doc_matters, - auto ref const O obj, + string[string] block(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -779,9 +779,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto verse(M,O)( - M doc_matters, - auto ref const O obj, + string[string] verse(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -802,9 +802,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto code(M,O)( - M doc_matters, - auto ref const O obj, + string[string] code(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -825,9 +825,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto table(M,O)( - M doc_matters, - auto ref const O obj, + string[string] table(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1166,8 +1166,8 @@ template SQLiteInsertMetadata() { } template SQLiteInsertDocObjectsLoop() { string SQLiteInsertDocObjectsLoop(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { string _uid = SQLinsertDelimiter!()(doc_matters.src.doc_uid); auto site_url = DocReformPathsUrl!()(doc_matters); |