aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sdp/ao_markup_source_raw.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2015-09-30 13:07:43 -0400
committerRalph Amissah <ralph@amissah.com>2015-09-30 13:12:21 -0400
commit45e96028ce7696381aca7f155c21b0b718b6a610 (patch)
treeeefcf5737cffc0d457bc433cd41ba21579076ff2 /lib/sdp/ao_markup_source_raw.d
sdp, abstract objects, a start
Diffstat (limited to 'lib/sdp/ao_markup_source_raw.d')
-rw-r--r--lib/sdp/ao_markup_source_raw.d58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/sdp/ao_markup_source_raw.d b/lib/sdp/ao_markup_source_raw.d
new file mode 100644
index 0000000..3710ff6
--- /dev/null
+++ b/lib/sdp/ao_markup_source_raw.d
@@ -0,0 +1,58 @@
+/*
+#+OPTIONS: ^:nil _:nil#+OPTIONS: ^:nil _:nil
+* sisu_markup_source_raw.d
+*/
+mixin template SiSUmarkupRaw() {
+ class MarkupRaw {
+ auto rgx = new Rgx();
+ final private string markupSourceString(in char[] fn_src) {
+ enforce(
+ match(fn_src, rgx.src_pth),
+ "not a sisu markup filename"
+ );
+ enforce(
+ exists(fn_src)!=0,
+ "file not found"
+ );
+ string source_txt_str = cast(string) read(fn_src);
+ std.utf.validate(source_txt_str);
+ return source_txt_str;
+ }
+ final private char[][] markupSourceLineArray(in string src_text) {
+ char[][] source_line_arr =
+ split(cast(char[]) src_text, rgx.line_delimiter);
+ return source_line_arr;
+ }
+ final char[][] markupSourceContentRawLineArray(in char[] fn_src) {
+ auto source_txt_str = markupSourceString(fn_src);
+ auto source_line_arr = markupSourceLineArray(source_txt_str);
+ return source_line_arr;
+ }
+ }
+ class MarkupInsertRaw {
+ auto rgx = new Rgx();
+ final private string markupSourceString(in char[] fn_src) {
+ enforce(
+ match(fn_src, rgx.src_fn_find_inserts),
+ "not a sisu markup filename"
+ );
+ enforce(
+ exists(fn_src)!=0,
+ "file not found"
+ );
+ string source_txt_str = cast(string) read(fn_src);
+ std.utf.validate(source_txt_str);
+ return source_txt_str;
+ }
+ final private char[][] markupSourceLineArray(in string src_text) {
+ char[][] source_line_arr =
+ split(cast(char[]) src_text, rgx.line_delimiter);
+ return source_line_arr;
+ }
+ final char[][] markupSourceContentRawLineArray(in char[] fn_src) {
+ auto source_txt_str = markupSourceString(fn_src);
+ auto source_line_arr = markupSourceLineArray(source_txt_str);
+ return source_line_arr;
+ }
+ }
+}